<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <style>
    button {
      width: 30px;
      height: 20px;
    }
  </style>
  <body>
    <select>
      <!-- <option value=""></option>
      <option value=""></option> -->
    </select>
    <button></button>
    <script>
      const select = document.querySelector("select");
      //定义一个数组
      const list = ["周一", "周二"];
      let html = "<option>周几</option>";
      html += list
        .map((item, index) => {
          return `<option value="${index + 1}">${item}</option> -->`;
        })
        .join("");
      select.innerHTML = html;
      select.addEventListener("change", function () {
        //获取输入框里面value值
        console.log(select.value);
      });
      const button = document.querySelector("button");
      button.addEventListener("click", function () {
        select.value = "1";
      });
    </script>
  </body>
</html>
